package com.ji.gametest.Impl;

import com.ji.gametest.interfaceDefine.ResultOperation;

import com.ji.gametest.pojo.Result;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ResultOperationImpl implements ResultOperation {



    @Override
    public Result StoneScissorsClothByPersonWin()
    {
        //人赢了
        Result result = new Result();
        result.setUserWin(result.getUserWin() + 1);
        result.setComputerLosses(result.getComputerLosses() + 1);
        log.info("人赢：{} 电脑赢：{} 平局：{}", result.getUserWin(), result.getComputerWin(), result.getUserDraws());
        System.out.println("人赢了");
        return result;
    }

    @Override
    public Result StoneScissorsClothByComputerWin()
    {
        //电脑赢
        Result result = new Result();
        result.setComputerWin(result.getComputerWin() + 1);
        result.setUserLosses(result.getUserLosses() + 1);
        log.info("人赢： {}电脑赢： {}平局：{}", result.getUserWin(), result.getComputerWin(), result.getUserDraws());
        System.out.println("电脑赢了");
        return result;
    }

    @Override
    public Result StoneScissorsClothByPersonAndComputerDraws()
    {
        //平局
        Result result = new Result();
        result.setUserDraws(result.getUserDraws() + 1);
        result.setComputerDraws(result.getComputerDraws() + 1);
        log.info("人赢：{} 电脑赢：{} 平局：{}", result.getUserWin(), result.getComputerWin(), result.getUserDraws());
        System.out.println("平局");
        return result;
    }
}
